Eve<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="a4j" uri="https://ajax4jsf.dev.java.net/ajax"%>
<%@taglib prefix="r" uri="http://richfaces.org/rich"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%> 
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <style type="text/css">@import url("../../css/style.css");</style>
    </head>
    <body>
        <div align="center">
            <f:view>
                <h:form id="form">
                    <table width="740" border="0" align="center">
                        <tr>
                            <td width="740" height="30" background="/Eventime/jsp/imagens/barra-consulta-evento.jpg" class="style1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Consultar Participantes por Empresa</td>
                        </tr>
                        <tr class="style2">
                            <td><table width="735" border="0" align="center">
                                    <tr>
                                        <td height="32" colspan="4"><div align="center"><h:inputText id="buscaPF" required="false" value="#{PesquisaPFPJ.valorBusca}" styleClass="border" onkeyup="javascript:this.value=this.value.toUpperCase();" size="60"></h:inputText>&nbsp;<h:commandButton id="pesquisa" value="Pesquisar" styleClass="style2" action="#{PesquisaPFPJ.pesquisa}"/></div></td>
                                    </tr>
                                    <tr>
                                        <td height="32" colspan="6" align="center">
                                            <h:selectOneRadio id="tipoBusca" value="#{PesquisaPFPJ.param}" styleClass="style2" required="true">
                                                <f:selectItem itemValue="razaoSocial" itemLabel="Entidade"></f:selectItem>
                                                <f:selectItem itemValue="nome" itemLabel="Nome"></f:selectItem>
                                                <f:selectItem itemValue="CPF" itemLabel="CPF"></f:selectItem>
                                                <f:selectItem itemValue="CodigoEmpresa" itemLabel="Codigo Empresa"></f:selectItem>
                                                <f:selectItem itemValue="CodigoPessoa" itemLabel="Codigo Pessoa"></f:selectItem>
                                            </h:selectOneRadio>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <r:datascroller id="scFisica" align="center" for="listaFisica" maxPages="20"/>
                                            <r:dataTable id="listaFisica" align="center" width="730" rows="7" value="#{PesquisaPFPJ.listPJPF}" var="listagemFisica" columnsWidth="200px" columnClasses="link" rowClasses="row, row2">
                                                <f:facet name="header">
                                                    <r:columnGroup style="align:center;">
                                                        <r:column width="200">
                                                            <h:outputText styleClass="headerText" value="Nome Completo" />
                                                        </r:column>
                                                        <r:column width="200">
                                                            <h:outputText styleClass="headerText" value="Empresa Vinculada" />
                                                        </r:column>
                                                        <r:column width="200">
                                                            <h:outputText styleClass="headerText" value="Endereço" />
                                                        </r:column>
                                                        <r:column width="50">
                                                            <h:outputText styleClass="headerText" value="UF" />
                                                        </r:column>
                                                        <r:column width="50">
                                                            <h:outputText styleClass="headerText" value="Material" />
                                                        </r:column>
                                                        <r:column width="80">
                                                            <h:outputText styleClass="headerText" value="Opções" />
                                                        </r:column>
                                                    </r:columnGroup>
                                                </f:facet>
                                                <r:column style="text-align:center">
                                                    <h:inputHidden id="codigo" value="#{listagemFisica.pessoaFisica.codigo}" />
                                                    <h:outputText value="#{listagemFisica.pessoaFisica.nome}" />
                                                </r:column>
                                                <r:column style="text-align:center">
                                                    <h:outputText value="#{listagemFisica.pessoaJuridica.razaoSocial}" />
                                                </r:column>
                                                <r:column style="text-align:center">
                                                    <h:outputText value="#{listagemFisica.pessoaJuridica.logradouro}" />
                                                </r:column>
                                                <r:column style="text-align:center">
                                                    <h:outputText value="#{listagemFisica.pessoaJuridica.cidade.estado.sigla}" />
                                                </r:column>
                                                <r:column style="text-align:center">
                                                    <h:selectBooleanCheckbox id="ckSelecao" value="#{PesquisaPFPJ.mapSelecionados[listagemFisica.pessoaFisica.codigo]}">
                                                        <a4j:support action="#{PesquisaPFPJ.recuperarMap}" event="onclick" reRender="listaFisica,entMat"/>
                                                        <r:componentControl for="loadPanel" event="onchange" attachTo="ckSelecao" operation="show"/>
                                                    </h:selectBooleanCheckbox>
                                                </r:column>
                                                <r:column style="text-align:center">
                                                    <h:commandButton value="Reimprimir" image="/jsp/imagens/print.png" action="#{PesquisaPFPJ.reimpressoa}" alt="Reimprimir">
                                                        <f:setPropertyActionListener value="#{listagemFisica.pessoaFisica.codigo}" target="#{PesquisaPFPJ.pessoaFisica.codigo}" />
                                                   </h:commandButton>
                                                    &nbsp;&nbsp;
                                                    <h:commandButton value="ReimprimirCurso" image="/jsp/imagens/cadCursos.png" action="#{CursoBean.reimpressao}" alt="Reimprimir">
                                                        <f:setPropertyActionListener value="#{listagemFisica.pessoaFisica.codigo}" target="#{CursoBean.pessoaFisica.codigo}" />
                                                   </h:commandButton>
                                                </r:column>
                                            </r:dataTable>
                                            <r:modalPanel id="loadPanel" autosized="true">
                                                <a4j:status id="load" onstop="#{r:component('loadPanel')}.hide()">
                                                    <f:facet name="start">
                                                        <h:graphicImage  value="/jsp/imagens/ajax-loader.gif"/>
                                                    </f:facet>
                                                </a4j:status>
                                            </r:modalPanel>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </f:view>
        </div>
    </body>
</html>